package day07_collections_map.com.itheima.d5_map_travesal;

import java.awt.*;
import java.util.Collection;
import java.util.HashMap;
import java.util.Set;

public class MapDemo1 {
    public static void main(String[] args) {
        HashMap<String, Integer> map = new HashMap<>();
        map.put("张三", 100);
        map.put("张三1", 99);
        map.put("张三2", 98);

        System.out.println("map = " + map);

        Set<String> keys = map.keySet();
        for (String key : keys) {
            Integer value = map.get(key);
            System.out.println(key + "=" + value);
        }
        System.out.println("--------------------------------");
        Collection<Integer> values = map.values();
        for (Integer value : values) {
            System.out.println(value);
        }
    }
}
